<?php

namespace Database\Factories;

use Illuminate\Database\Eloquent\Factories\Factory;

class UserAddressFactory extends Factory
{
    /**
     * Define the model's default state.
     *
     * @return array
     */
    public function definition()
    {
        $addresses = [
            ["北京市", "市辖区", "海淀区"],
            ["山西省", "太原市", "小店区"],
            ["山西省", "太原市", "晋源区"],
            ["山东省", "菏泽市", "牡丹区"],
            ["山东省", "聊城市", "东昌府区"],
        ];
        $address = $this->faker->randomElement($addresses);
        return [
            'province'=>$address[0],
            'city'=>$address[1],
            'district'=>$address[2],
            'address'=>sprintf('第%d街道门牌号%d',$this->faker->randomNumber(2),$this->faker->randomNumber(3)),
            'zip'=>$this->faker->postcode,
            'contact_name'=>$this->faker->name,
            'contact_phone'=>$this->faker->phoneNumber
        ];
    }
}
